#include "reponse.h"
#include "question.h"

Reponse::Reponse(int idRep, QObject *parent) :
    QObject(parent)
{
    QSqlQuery rep;
    rep.exec("SELECT id_rep, num_rep, intitule_rep, quest_suiv FROM reponses WHERE id_rep = " + QString::number(idRep) + ";");
    rep.next();
    this->id = rep.value(0).toInt();
    this->num = rep.value(1).toInt();
    this->texte = rep.value(2).toString();
    this->qSuivante = rep.value(3).toInt();
}

int Reponse::getId() const
{
    return id;
}

void Reponse::setId(int newId)
{
    id = newId;
}

int Reponse::getNum() const
{
    return num;
}

void Reponse::setNum(int newNum)
{
    num = newNum;
}

QString Reponse::getTexte() const
{
    return texte;
}

void Reponse::setTexte(QString newTexte)
{
    texte = newTexte;
}

int Reponse::getQSuivante() const
{
    return qSuivante;
}

void Reponse::setQSuivante(int newQSuivante)
{
    qSuivante = newQSuivante;
}
